import request from '@/utils/request'

export function getRolesList(data) {
  return request({
    url: '/tenant/role?pageSize=' + data.pageSize + '&pageNo=' + data.pageNo,
    method: 'get'
  })
}

// user  role
export function userRole(id) {
  return request({
    url: '/tenant/role/user/' + id,
    method: 'get'
  })
}

export function addRole(data) {
  return request({
    url: '/vue-element-admin/role',
    method: 'post',
    data
  })
}

export function updateRole(id, data) {
  return request({
    url: `/vue-element-admin/role/${id}`,
    method: 'put',
    data
  })
}

export function deleteRole(id) {
  return request({
    url: `/vue-element-admin/role/${id}`,
    method: 'delete'
  })
}
